Skip to content

Conversation

@axshani
Copy link
Contributor

@axshani axshani commented Jun 23, 2021

No description provided.

}

// public async createToken(request: CreateTokenRequest) : Promise<UnitResponse<CustomerToken> | UnitError> {
public async createToken(request: CreateTokenRequest) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets keep the method signature
and remove the comment

/**
* send a verification code to the customer through one of the following channels sms or call.
*/
channel: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use "sms" | "call" (verify with the docs)

Suggested change
channel: string
channel: "sms" | "call"

* string 6 digits code sent to the customer through the desired channel.
* Required if the scope attribute includes a scope which requires two-factor authentication.
*/
verificationCode?: string}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
verificationCode?: string}
verificationCode?: string
}

}

export interface CreateTokenVerificationRequest {
customerId: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not really part of this request, its the identifier of this route so move it from the request and lets add it as a parameter to createTokenVerification

import { Phone } from "./common";

export interface CreateTokenRequest {
customerId: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see me comment on:
CreateTokenVerificationRequest

super(token,basePath + '/customers')
}

public async createToken(request: CreateTokenRequest) : Promise<UnitResponse<CustomerToken> | UnitError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public async createToken(request: CreateTokenRequest) : Promise<UnitResponse<CustomerToken> | UnitError> {
public async createToken(customerId: string, request: CreateTokenRequest) : Promise<UnitResponse<CustomerToken> | UnitError> {

return this.httpPost<UnitResponse<CustomerToken>>(`/${request.customerId}/token`, { data: request.data })
}

public async createTokenVerification(request: CreateTokenVerificationRequest) : Promise<UnitResponse<VerificationToken> | UnitError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public async createTokenVerification(request: CreateTokenVerificationRequest) : Promise<UnitResponse<VerificationToken> | UnitError> {
public async createTokenVerification(customerId:string, request: CreateTokenVerificationRequest) : Promise<UnitResponse<VerificationToken> | UnitError> {

@Elroie Elroie merged commit 0957617 into main Jun 24, 2021
@Elroie Elroie deleted the customer-token branch June 24, 2021 15:43
ilyamerman pushed a commit that referenced this pull request May 30, 2022
YegorZh pushed a commit to YegorZh/unit-node-sdk that referenced this pull request Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants